import pyecharts.options as opts
from pyecharts.charts import Line
from pyecharts.faker import Faker



x_timeList = ["18:48:20","18:49:20","18:50:20","18:51:20","18:52:20","18:53:20","18:54:41",]
y_list = [1,2,3,4,5,6,7,8,9,10]
def sell_result2() -> Line:
    c = (
            Line()
            .add_xaxis(x_timeList)
            .set_global_opts(title_opts=opts.TitleOpts(title="公司销售情况"))
        )

    for i in range(10):
        c_ = (
            Line()
            .add_xaxis(x_timeList)
            # .add_yaxis(columns[i], data[i])
            .add_yaxis(
                "车辆id{}".format(i),
                y_list[i],
                is_symbol_show=False,
                is_connect_nones=True,
                linestyle_opts=opts.LineStyleOpts(width=2),
                label_opts=opts.LabelOpts(is_show=False), )
        )
        c.overlap(c_)
    return c

sell_result2().render('循环细节设置.html')

# c = (
#     Line()
#     .add_xaxis([
#     "18:48:20",
#     "18:49:20",
#     "18:50:20",
#     "18:51:20",
#     "18:52:20",
#     "18:53:20",
#     "18:54:41",
# ])
#     .add_yaxis(
#         "商家C",
#         [
#             1300,
#             1280,
#             1250,
#             1260,
#             1270,
#             1300,
#             1550,
#             1500,
#             1400,
#             1390,
#             1380,
#             1390,
#             1400,
#             1500,
#             1600,
#             1750,
#             1800,
#             1700,
#             1600,
#             1400,
#             1300,
#             1280,
#             1250,
#             1260,
#             1270,
#         ],
#         markline_opts=opts.MarkLineOpts(data=[opts.MarkLineItem(type_="average")]),
#     )
#     .add_yaxis(
#         "商家A",
#         [
#             300,
#             280,
#             250,
#             260,
#             270,
#             300,
#             550,
#             500,
#             400,
#             390,
#             380,
#             390,
#             400,
#             500,
#             600,
#             750,
#             800,
#             700,
#             600,
#             400,
#             300,
#             280,
#             250,
#             260,
#             260,
#         ],
#         markline_opts=opts.MarkLineOpts(data=[opts.MarkLineItem(type_="average")]),
#     )
#     .add_yaxis(
#         "商家B",
#         [
#             1300,
#             1280,
#             1250,
#             1260,
#             1270,
#             1300,
#             1550,
#             1500,
#             1400,
#             1390,
#             1380,
#             1390,
#             1400,
#             1500,
#             1600,
#             1750,
#             1800,
#             1700,
#             1600,
#             1400,
#             1300,
#             1280,
#             1250,
#             1260,
#             1270,
#         ],
#         markline_opts=opts.MarkLineOpts(data=[opts.MarkLineItem(type_="average")]),
#     )
#
#     .set_global_opts(title_opts=opts.TitleOpts(title="Line-MarkLine"))
#     .render("line_markline.html")
# )
